<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:ui="http://java.sun.com/jsf/facelets" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:f="http://java.sun.com/jsf/core">
      
      <h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
	<title>Cadastrar Cliente</title>
</h:head>
      
      
      <body>
      
      <h:form>
<h:inputHidden value="#{clienteBean.alterar}" />
<h:inputHidden value="#{clienteBean.cliente.cpf}" rendered="#{clienteBean.alterar}" />
<table border="1">
	<tr>
		<td colspan="2" align="center"><h3>Dados do Aluno</h3></td>
	</tr>
	<tr>
		<td style="width: 120px;">Cpf:</td>
		<td style="width: 230px;"><b>
			<h:outputText value="#{clienteBean.cliente.cpf}" rendered="#{alunos.alterar}" />
			<h:inputText value="#{clienteBean.cliente.cpf}" rendered="#{!alunos.alterar}" maxlength="10" required="true" />
		</b></td>
	</tr>
	<tr>
		<td style="width: 120px;">Nome:</td>
		<td style="width: 230px;"><h:inputText value="#{clienteBean.cliente.nome}" maxlength="50" required="true" /></td>
	</tr>
	<tr>
		<td style="width: 120px;">Email:</td>
		<td style="width: 230px;">
			<h:inputText value="#{clienteBean.cliente.email}" maxlength="20" required="true"/>				
		</td>
	</tr>
	<tr>
		<td style="width: 120px;">Endereço:</td>
		<td style="width: 230px;">
			<h:inputText value="#{clienteBean.cliente.endereco}" maxlength="20" required="true"/>				
		</td>
	</tr>
	<tr>
		<td style="width: 120px;">Data:</td>
		<td style="width: 230px;">
			<h:inputText value="#{clienteBean.cliente.dataCadastro}" maxlength="20" required="true">
			<f:convertDateTime pattern="dd/MM/yyyy"/>
			</h:inputText>				
		</td>
	</tr>	
	
	<tr>
		<td style="width: 120px;">Renda:</td>
		<td style="width: 230px;">
			<h:inputText value="#{clienteBean.cliente.renda}" maxlength="20" required="true">
			<f:convertDateTime pattern="dd/MM/yyyy"/>
			</h:inputText>				
		</td>
	</tr>	
	
	<tr>
		<td align="right" colspan="2">
			<h:button value="Cancelar" outcome="PrimeiroJSF" />
			<h:commandButton value="Gravar" action="#{clienteBean.adicionar}" />
		</td>
	</tr>	
	
	
</table>
</h:form>     
      
      
      </body>
      

   
   
</html>